package priv.pfz.qatool.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.google.common.collect.Lists;
import priv.pfz.qatool.enums.QAToolMethodAuth;
import priv.pfz.qatool.enums.QAToolMethodType;

import java.lang.reflect.Method;
import java.util.List;

/**
 * Created by fangzhou.peng on 2017/8/3.
 */
public class QTMethod {

    /**
     * java方法
     */
    @JSONField(serialize = false)
    private Method method;

    /**
     * java方法名
     */
    private String methodName;

    /**
     * 参数
     */
    private List<QTParam> params = Lists.newArrayList();

    /**
     * 类型
     */
    private QAToolMethodType type = QAToolMethodType.HTML;

    /**
     * 方法名
     */
    private String name;

    /**
     * 说明
     */
    private List<String> descs;

    /**
     * 访问权限
     */
    private QAToolMethodAuth auth = QAToolMethodAuth.DEV;

    /**
     * 是否是api
     */
    private boolean api;

    public QTMethod() {

    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public List<QTParam> getParams() {
        return params;
    }

    public void setParams(List<QTParam> params) {
        this.params = params;
    }

    public void addParam(QTParam param) {
        this.params.add(param);
    }

    public QAToolMethodType getType() {
        return type;
    }

    public void setType(QAToolMethodType type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<String> getDescs() {
        return descs;
    }

    public void setDescs(List<String> descs) {
        this.descs = descs;
    }

    public QAToolMethodAuth getAuth() {
        return auth;
    }

    public void setAuth(QAToolMethodAuth auth) {
        this.auth = auth;
    }

    public boolean isApi() {
        return api;
    }

    public void setApi(boolean api) {
        this.api = api;
    }
}
